
package jweslley.ProblemSetVolumes.VolumeII;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

import jweslley.Problem;
import jweslley.Problem.Status;

/**
 * http://icpcres.ecs.baylor.edu/onlinejudge/external/2/272.html
 *
 * @author  Jonhnny Weslley
 * @version 1.00, 17/10/2008
 */
@Problem(Status.Accepted)
public class TEXQuotes {

	private static final String QUOTE = "\"";

	public static void main(String[] args) throws IOException {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		String line;
		boolean mustClose = false;
		while ((line = in.readLine()) != null) {
			while (line.contains(QUOTE)) {
				line = mustClose ? line.replaceFirst(QUOTE, "''") : line.replaceFirst(QUOTE, "``");
				mustClose = !mustClose;
			}
			System.out.println(line);
		}
	}

}
